// Copyright (C) 2024 Shpz<shaaapz@gmail.com>. All Rights Reserved.

import { Line, _decorator } from 'cc';
import { Pawn } from './Pawn';

const { ccclass, requireComponent } = _decorator;

@ccclass('Spectator')
export class Spectator extends Pawn {
    protected line: Line;

    start() {
        super.start();
        this.line = this.getComponent(Line);
    }

    possess() {        
        super.possess();
        this.line.enabled = true;
    }

    unpossess() {
        super.unpossess();
        this.line.enabled = false;
    }
}